import pronouncing


def get_phonetic(word):
    phones = pronouncing.phones_for_word(word)
    if phones:
        return phones[0]
    else:
        return "没有找到该单词的音标"


def main():
    while True:
        word = input("请输入一个英语单词,或者exit：")
        if word.lower() == "exit":
            print("程序结束")
            break
        phonetic = get_phonetic(word)
        print(f"{word}的音标是：{phonetic}")


if __name__ == '__main__':
    main()
